home *** CD-ROM | disk | FTP | other *** search
Text File | 1991-03-06 | 4.2 KB | 101 lines | [TEXT/GEOL] |
- Item 6065592 11-Sept-90 20:52PDT
-
- From: SATORI Satori SW, Hugh Rogovy,PRT
-
- To: MACAPP.TECH$ MacApp Technical
-
- Sub: re:[de]Activate Timing (long)
-
-
- Tommi & Gerhard, thanks *A LOT* for sharing your findings regarding the slow
- [de]activates in complicated views. Your suggestions were both fine, but we
- decided instead to make a wholesale modification to MacApp. After taking a
- look at the section of MacApp you pointed out, I've decided that the *real*
- culprit isn't just the view tree walking through the Activate method. What's
- happening is that every single view in a window is taking a hit just to see if
- it would be OK to call DoHilightSelection. The only TView subclass in MacApp
- that even uses DoHilightSelection is TGridView. This isn't alone all that
- horrible because walking straight *down* the view tree and calling an empty
- method doesn't really take all that much time (even with 2000 views). The
- sickening thing in TView.Activate, is the line:
-
- IF Focus & IsVisible THEN
-
- Both of the above methods can cause ANOTHER walk *UP* the view tree performing
- unneeded Boolean evaluations and region manipulations. On top of that, I
- didn't think a view could be focused unless it was visible (unless my version
- of MacApp has been modified beyond recognition…), which means that the order of
- evaluation is wrong in the IF statement. Also, once I do hit a view in which
- (Focus & IsVisible)=FALSE then none of the subviews can possible evaluate to
- (Focus & IsVisible)=TRUE (but they're checked again anyway!!). That's a pretty
- ridiculous way to make sure that TGridViews get their selections during an
- activate.
-
- Our way of getting around this is more of a kludge that anything else, but
- nobody can say it's worse than what was already there. We have modified TView
- to contain a new instance variable called fWantHilighting which we default to
- FALSE all non-hilightable views and check during TView.Activate as shown below.
- Another (probably more correct) solution might be to call DoHighlightSelection
- from a TGridView.Activate OVERRIDE method rather than from TView.Activate.
- There's probably an even better solution...
-
-
- ***SOAPBOX TIME***
- Ok, it's well past mealtime (both lunch & dinner), I'm irritable and this will
- most likely be the only time you'll hear me talk this way about MacApp (unless
- you visit my office), so bear with me as I go off into tirade-land for a
- moment...
-
- I wouldn't be so irritated by the TView.Activate problem if I hadn't been
- through so many other time-consuming (ie. $-consuming) problems with the
- release version of MA 2.0! I don't need to be specific, we all know what I'm
- talking about. I'm really tired of defending myself to my superiors because of
- something that someone else destroyed in our perfectly working app. I have to
- wonder if they'll ever trust my judgement again regarding development
- environments (yes, I'm the bonehead who convinced them that MacApp would make
- life easier). It's still probably true that MacApp saved us time, but another
- few dozen pages of bug fixes may change my mind really fast. MacApp
- team...please...please write yourselves a more complete set of test
- applications. At least 80% of the bugs that have surfaced in MacApp have shown
- up in at least one of the applications we're using it for. I'm not saying that
- we found them first - just that they were there and fairly obvious. It is
- inexcusable that they make it out Cupertino...
-
- whew...I feel a tiny bit better...and I do still look forward to MacApp being a
- way of life for our development team...after it stabilizes a little...really...
-
-
- Chris Le Croy
- Satori Software
-
-
- Tommi & Gerhard, thanks again...
-
- ****************************************************************
- PROCEDURE TView.Activate(entering: BOOLEAN);
-
- VAR
- newHL: HLState;
-
- PROCEDURE ActivateSubView(theSubView: TView);
-
- BEGIN
- theSubView.Activate(entering);
- END;
-
- BEGIN
- IF fWantHilighting THEN
- BEGIN
- IF entering THEN
- newHL := hlOn
- ELSE
- newHL := hlDim;
- IF Focus & IsVisible THEN
- DoHighlightSelection(fHLDesired, newHL);
- fHLDesired := newHL;
- END;
- EachSubView(ActivateSubView);
- END;
-
-
-